File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121### Other Changes
2222
23- Updated PHPUnit to v9.6 to avoid [ vulnerability] ( https://github.com/ICanBoogie/Inflector/security/dependabot/1 ) .
23+ - Updated PHPUnit to v9.6 to avoid [ vulnerability] ( https://github.com/ICanBoogie/Inflector/security/dependabot/1 ) .
24+ - Throw ` Error ` instead of ` PropertyNotDefined ` /` InvalidArgumentException ` .
25+ - Remove dependency on ` icanboogie/common ` .
26+
2427
2528
2629
Original file line number Diff line number Diff line change 3333 "ext-mbstring" : " *"
3434 },
3535 "require-dev" : {
36- "icanboogie/common" : " ^2.1" ,
3736 "phpstan/phpstan" : " ^2.1" ,
3837 "phpunit/phpunit" : " ^9.6.34|^11.4"
3938 },
Original file line number Diff line number Diff line change @@ -106,20 +106,15 @@ public static function get(string $locale = Inflector::DEFAULT_LOCALE): Inflecti
106106 *
107107 * @return mixed
108108 *
109- * @throws PropertyNotDefined in an attempt to read an inaccessible property. If the {@see PropertyNotDefined}
110- * class is not available a {@see \InvalidArgumentException} is thrown instead.
109+ * @throws \Error in an attempt to read an inaccessible property.
111110 */
112111 public function __get (string $ property )
113112 {
114113 if (isset (self ::READERS [$ property ])) {
115114 return $ this ->$ property ;
116115 }
117116
118- if (class_exists (PropertyNotDefined::class)) {
119- throw new PropertyNotDefined ([ $ property , $ this ]);
120- } else {
121- throw new InvalidArgumentException ("Property not defined: $ property " );
122- }
117+ throw new \Error ("Undefined property: " . self ::class . ":: \$$ property " );
123118 }
124119
125120 /**
Original file line number Diff line number Diff line change @@ -62,20 +62,15 @@ public function __construct(?Inflections $inflections = null)
6262 * Returns the {@see $inflections} property.
6363 *
6464 * @return mixed
65- * @throws PropertyNotDefined in an attempt to read an inaccessible property. If the {@see PropertyNotDefined}
66- * class is not available a {@see InvalidArgumentException} is thrown instead.
65+ * @throws \Error in an attempt to read an inaccessible property.
6766 */
6867 public function __get (string $ property )
6968 {
7069 if ($ property === 'inflections ' ) {
7170 return $ this ->$ property ;
7271 }
7372
74- if (class_exists (PropertyNotDefined::class)) {
75- throw new PropertyNotDefined ([ $ property , $ this ]);
76- } else {
77- throw new InvalidArgumentException ("Property not defined: $ property " );
78- }
73+ throw new \Error ("Undefined property: " . static ::class . ":: \$$ property " );
7974 }
8075
8176 /**
You can’t perform that action at this time.
0 commit comments