@@ -64,12 +64,10 @@ public static function loadEndpointsFromCamelFiles(string $folder, callable $cal
64
64
$ contents = Utils::listDirectoryContents ($ folder );
65
65
66
66
foreach ($ contents as $ object ) {
67
- // todo Flysystem v1 had items as arrays; v2 has objects.
68
- // v2 allows ArrayAccess, but when we drop v1 support (Laravel <9), we should switch to methods
69
67
if (
70
- $ object[ ' type ' ] == ' file '
71
- && Str::endsWith (basename ($ object[ ' path ' ] ), '.yaml ' )
72
- && !Str::startsWith (basename ($ object[ ' path ' ] ), 'custom. ' )
68
+ $ object-> isFile ()
69
+ && Str::endsWith (basename ($ object-> path () ), '.yaml ' )
70
+ && !Str::startsWith (basename ($ object-> path () ), 'custom. ' )
73
71
) {
74
72
$ group = Yaml::parseFile ($ object ['path ' ]);
75
73
$ callback ($ group );
@@ -83,14 +81,12 @@ public static function loadUserDefinedEndpoints(string $folder): array
83
81
84
82
$ userDefinedEndpoints = [];
85
83
foreach ($ contents as $ object ) {
86
- // todo Flysystem v1 had items as arrays; v2 has objects.
87
- // v2 allows ArrayAccess, but when we drop v1 support (Laravel <9), we should switch to methods
88
84
if (
89
- $ object[ ' type ' ] == ' file '
90
- && Str::endsWith (basename ($ object[ ' path ' ] ), '.yaml ' )
91
- && Str::startsWith (basename ($ object[ ' path ' ] ), 'custom. ' )
85
+ $ object-> isFile ()
86
+ && Str::endsWith (basename ($ object-> path () ), '.yaml ' )
87
+ && Str::startsWith (basename ($ object-> path () ), 'custom. ' )
92
88
) {
93
- $ endpoints = Yaml::parseFile ($ object[ ' path ' ] );
89
+ $ endpoints = Yaml::parseFile ($ object-> path () );
94
90
foreach (($ endpoints ?: []) as $ endpoint ) {
95
91
$ userDefinedEndpoints [] = $ endpoint ;
96
92
}
0 commit comments