@@ -31,7 +31,7 @@ trait HasRelations
3131 *
3232 * @return \Swis\JsonApi\Client\Relations\HasOneRelation
3333 */
34- public function hasOne (string $ itemClass , string $ name = null ): OneRelationInterface
34+ public function hasOne (string $ itemClass , ? string $ name = null ): OneRelationInterface
3535 {
3636 $ name = $ name ?: $ this ->guessRelationName ();
3737
@@ -55,7 +55,7 @@ protected function newHasOne(string $type): OneRelationInterface
5555 *
5656 * @return \Swis\JsonApi\Client\Relations\HasManyRelation
5757 */
58- public function hasMany (string $ itemClass , string $ name = null ): ManyRelationInterface
58+ public function hasMany (string $ itemClass , ? string $ name = null ): ManyRelationInterface
5959 {
6060 $ name = $ name ?: $ this ->guessRelationName ();
6161
@@ -78,7 +78,7 @@ protected function newHasMany(string $type): ManyRelationInterface
7878 *
7979 * @return \Swis\JsonApi\Client\Relations\MorphToRelation
8080 */
81- public function morphTo (string $ name = null ): OneRelationInterface
81+ public function morphTo (? string $ name = null ): OneRelationInterface
8282 {
8383 $ name = $ name ?: $ this ->guessRelationName ();
8484
@@ -101,7 +101,7 @@ protected function newMorphTo(): OneRelationInterface
101101 *
102102 * @return \Swis\JsonApi\Client\Relations\MorphToManyRelation
103103 */
104- public function morphToMany (string $ name = null ): ManyRelationInterface
104+ public function morphToMany (? string $ name = null ): ManyRelationInterface
105105 {
106106 $ name = $ name ?: $ this ->guessRelationName ();
107107
@@ -182,7 +182,7 @@ public function getRelationValue(string $name): ?DataInterface
182182 *
183183 * @return static
184184 */
185- public function setRelation (string $ relation , $ value = false , Links $ links = null , Meta $ meta = null )
185+ public function setRelation (string $ relation , $ value = false , ? Links $ links = null , ? Meta $ meta = null )
186186 {
187187 $ method = Util::stringCamel ($ relation );
188188 if (method_exists ($ this , $ method )) {
0 commit comments