str_ends_with

Supported Versions: PHP 8
Checks if a string ends with a given substring
<?php str_ends_with(string $haystack, string $needle): bool
<?php     {

        return Targeted::make(

            $this,

            fn (ObjectDescription $object): bool => str_ends_with($object->reflectionClass->getName(), $suffix),

            "to have suffix '{$suffix}'",

            FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),

        );
<?php     {

        return Targeted::make(

            $this->original,

            fn (ObjectDescription $object): bool => ! str_ends_with($object->reflectionClass->getName(), $suffix),

            "not to have suffix '{$suffix}'",

            FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),

        );
<?php     public static function testStdOut(string $name, string $data): self

    {

        if (! str_ends_with($data, "\n")) {

            $data .= "\n";

        }
<?php     public static function testStdErr(string $name, string $data): self

    {

        if (! str_ends_with($data, "\n")) {

            $data .= "\n";

        }
<?php         $files = [

            ...array_values(array_filter(

                $suiteLoader->tests,

                fn (string $filename): bool => ! str_ends_with($filename, "eval()'d code")

            )),

            ...TestSuite::getInstance()->tests->getFilenames(),

        ];