mirror of
				https://github.com/sitelease/sugar-cube-client.git
				synced 2025-10-31 12:02:30 +01:00 
			
		
		
		
	Added __toString() methods
				
					
				
			This commit is contained in:
		| @ -63,6 +63,15 @@ class PushEvent implements \JsonSerializable { | |||||||
|     $this->commits = new \ArrayObject; |     $this->commits = new \ArrayObject; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * Returns a string representation of this object. | ||||||
|  |    * @return string The string representation of this object. | ||||||
|  |    */ | ||||||
|  |   function __toString(): string { | ||||||
|  |     $json = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||||||
|  |     return static::class." $json"; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * Creates a new event from the specified JSON map. |    * Creates a new event from the specified JSON map. | ||||||
|    * @param object $map A JSON map representing an event. |    * @param object $map A JSON map representing an event. | ||||||
|  | |||||||
| @ -55,6 +55,15 @@ class PayloadCommit implements \JsonSerializable { | |||||||
|     $this->setMessage($message); |     $this->setMessage($message); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * Returns a string representation of this object. | ||||||
|  |    * @return string The string representation of this object. | ||||||
|  |    */ | ||||||
|  |   function __toString(): string { | ||||||
|  |     $json = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||||||
|  |     return static::class." $json"; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * Creates a new commit from the specified JSON map. |    * Creates a new commit from the specified JSON map. | ||||||
|    * @param object $map A JSON map representing a commit. |    * @param object $map A JSON map representing a commit. | ||||||
|  | |||||||
| @ -35,6 +35,15 @@ class PayloadCommitVerification implements \JsonSerializable { | |||||||
|     $this->setVerified($isVerified); |     $this->setVerified($isVerified); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * Returns a string representation of this object. | ||||||
|  |    * @return string The string representation of this object. | ||||||
|  |    */ | ||||||
|  |   function __toString(): string { | ||||||
|  |     $json = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||||||
|  |     return static::class." $json"; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * Creates a new commit from the specified JSON map. |    * Creates a new commit from the specified JSON map. | ||||||
|    * @param object $map A JSON map representing a commit. |    * @param object $map A JSON map representing a commit. | ||||||
|  | |||||||
| @ -30,6 +30,15 @@ class PayloadUser implements \JsonSerializable { | |||||||
|     $this->username = $username; |     $this->username = $username; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * Returns a string representation of this object. | ||||||
|  |    * @return string The string representation of this object. | ||||||
|  |    */ | ||||||
|  |   function __toString(): string { | ||||||
|  |     $json = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||||||
|  |     return static::class." $json"; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * Creates a new user from the specified JSON map. |    * Creates a new user from the specified JSON map. | ||||||
|    * @param object $map A JSON map representing a user. |    * @param object $map A JSON map representing a user. | ||||||
|  | |||||||
| @ -32,6 +32,15 @@ class Permission implements \JsonSerializable { | |||||||
|     $this->setAdmin($admin)->setPull($pull)->setPush($push); |     $this->setAdmin($admin)->setPull($pull)->setPush($push); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * Returns a string representation of this object. | ||||||
|  |    * @return string The string representation of this object. | ||||||
|  |    */ | ||||||
|  |   function __toString(): string { | ||||||
|  |     $json = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||||||
|  |     return static::class." $json"; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * Creates a new user from the specified JSON map. |    * Creates a new user from the specified JSON map. | ||||||
|    * @param object $map A JSON map representing a user. |    * @param object $map A JSON map representing a user. | ||||||
|  | |||||||
| @ -135,6 +135,15 @@ class Repository implements \JsonSerializable { | |||||||
|     $this->setFullName($fullName); |     $this->setFullName($fullName); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * Returns a string representation of this object. | ||||||
|  |    * @return string The string representation of this object. | ||||||
|  |    */ | ||||||
|  |   function __toString(): string { | ||||||
|  |     $json = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||||||
|  |     return static::class." $json"; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * Creates a new repository from the specified JSON map. |    * Creates a new repository from the specified JSON map. | ||||||
|    * @param object $map A JSON map representing a repository. |    * @param object $map A JSON map representing a repository. | ||||||
|  | |||||||
| @ -20,6 +20,15 @@ class ServerVersion implements \JsonSerializable { | |||||||
|     $this->version = $version; |     $this->version = $version; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * Returns a string representation of this object. | ||||||
|  |    * @return string The string representation of this object. | ||||||
|  |    */ | ||||||
|  |   function __toString(): string { | ||||||
|  |     $json = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||||||
|  |     return static::class." $json"; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * Creates a new server version from the specified JSON map. |    * Creates a new server version from the specified JSON map. | ||||||
|    * @param object $map A JSON map representing a server version. |    * @param object $map A JSON map representing a server version. | ||||||
|  | |||||||
| @ -37,6 +37,15 @@ class Team implements \JsonSerializable { | |||||||
|     $this->setName($name); |     $this->setName($name); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * Returns a string representation of this object. | ||||||
|  |    * @return string The string representation of this object. | ||||||
|  |    */ | ||||||
|  |   function __toString(): string { | ||||||
|  |     $json = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||||||
|  |     return static::class." $json"; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * Creates a new user from the specified JSON map. |    * Creates a new user from the specified JSON map. | ||||||
|    * @param object $map A JSON map representing a user. |    * @param object $map A JSON map representing a user. | ||||||
|  | |||||||
| @ -50,6 +50,15 @@ class User implements \JsonSerializable { | |||||||
|     $this->setLogin($login); |     $this->setLogin($login); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * Returns a string representation of this object. | ||||||
|  |    * @return string The string representation of this object. | ||||||
|  |    */ | ||||||
|  |   function __toString(): string { | ||||||
|  |     $json = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||||||
|  |     return static::class." $json"; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * Creates a new user from the specified JSON map. |    * Creates a new user from the specified JSON map. | ||||||
|    * @param object $map A JSON map representing a user. |    * @param object $map A JSON map representing a user. | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user