File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- [ ![ version] ( https://img.shields.io/badge/Version-2.0.1 -brightgreen.svg )] ( https://github.com/SimonDevelop/sirene/releases/tag/2.0.1 )
1+ [ ![ version] ( https://img.shields.io/badge/Version-2.0.2 -brightgreen.svg )] ( https://github.com/SimonDevelop/sirene/releases/tag/2.0.2 )
22[ ![ Minimum PHP Version] ( https://img.shields.io/badge/php-%3E%3D%208.1-8892BF.svg )] ( https://php.net/ )
33[ ![ Github Actions PHP] ( https://github.com/SimonDevelop/sirene/workflows/PHP/badge.svg )] ( https://github.com/SimonDevelop/sirene/actions )
44[ ![ GitHub license] ( https://img.shields.io/badge/License-MIT-blue.svg )] ( https://github.com/SimonDevelop/sirene/blob/master/LICENSE )
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public function informations(): array|bool
6363 }
6464 curl_close ($ ch );
6565
66- return json_decode ($ result , true );
66+ return is_null ( json_decode ( $ result , true )) ? false : json_decode ($ result , true );
6767 }
6868
6969 /**
@@ -86,7 +86,7 @@ public function siret(string $siret): array|bool
8686 }
8787 curl_close ($ ch );
8888
89- return json_decode ($ result , true );
89+ return is_null ( json_decode ( $ result , true )) ? false : json_decode ($ result , true );
9090 }
9191
9292 /**
@@ -109,7 +109,7 @@ public function siren(string $siren): array|bool
109109 }
110110 curl_close ($ ch );
111111
112- return json_decode ($ result , true );
112+ return is_null ( json_decode ( $ result , true )) ? false : json_decode ($ result , true );
113113 }
114114
115115 /**
@@ -157,7 +157,7 @@ public function searchEtablissement(
157157 }
158158 curl_close ($ ch );
159159
160- return json_decode ($ result , true );
160+ return is_null ( json_decode ( $ result , true )) ? false : json_decode ($ result , true );
161161 } else {
162162 return false ;
163163 }
You can’t perform that action at this time.
0 commit comments