Skip to content

Commit

Permalink
Clean up endsWith()
Browse files Browse the repository at this point in the history
  • Loading branch information
csev committed Jan 20, 2024
1 parent ffc437d commit 00a262b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

"nesbot/carbon" : "2.68.1",

"tsugi/lib": "dev-master#43a4c67b76c407d37bed85fbcddaa6be5642ff62",
"tsugi/lib": "dev-master#175e4550fd1dfa3be34deda138de9f69cd3ec2d3",
"koseu/lib": "dev-master#70c7ac1ca413c2dd541e078ebe07719405621b1b"
},
"config": {
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7511,12 +7511,12 @@
"source": {
"type": "git",
"url": "https://github.com/tsugiproject/tsugi-php.git",
"reference": "43a4c67b76c407d37bed85fbcddaa6be5642ff62"
"reference": "175e4550fd1dfa3be34deda138de9f69cd3ec2d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tsugiproject/tsugi-php/zipball/43a4c67b76c407d37bed85fbcddaa6be5642ff62",
"reference": "43a4c67b76c407d37bed85fbcddaa6be5642ff62",
"url": "https://api.github.com/repos/tsugiproject/tsugi-php/zipball/175e4550fd1dfa3be34deda138de9f69cd3ec2d3",
"reference": "175e4550fd1dfa3be34deda138de9f69cd3ec2d3",
"shasum": ""
},
"require": {
Expand All @@ -7529,7 +7529,7 @@
"phpunit/php-timer": "v5.0.3",
"phpunit/phpunit": "9.*"
},
"time": "2024-01-17T16:28:35+00:00",
"time": "2024-01-20T06:30:30+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
Expand Down
6 changes: 3 additions & 3 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '95c7b762d3080739f3360ddb7e205d18970a8940',
'reference' => 'ffc437da39f2104f8922035db0d4d4b3148b126c',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '95c7b762d3080739f3360ddb7e205d18970a8940',
'reference' => 'ffc437da39f2104f8922035db0d4d4b3148b126c',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -1045,7 +1045,7 @@
'tsugi/lib' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '43a4c67b76c407d37bed85fbcddaa6be5642ff62',
'reference' => '175e4550fd1dfa3be34deda138de9f69cd3ec2d3',
'type' => 'library',
'install_path' => __DIR__ . '/../tsugi/lib',
'aliases' => array(
Expand Down
1 change: 1 addition & 0 deletions vendor/tsugi/lib/src/Util/U.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ public static function startsWith($haystack, $needle) {

public static function endsWith($haystack, $needle) {
// search forward starting from end minus needle length characters
if ( !is_string($haystack) || !is_string($needle) ) return false;
return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);
}

Expand Down

0 comments on commit 00a262b

Please sign in to comment.