コード例 #1
0
 /**
  * Check if the header field has a mapping class.
  * @param string $headerFieldName
  * @return boolean
  */
 public function hasClass($headerFieldName)
 {
     Assert::isStringOrInteger($headerFieldName);
     return isset($this->map[$headerFieldName]);
 }
コード例 #2
0
 /** {@inheritDoc} */
 public function has($adapterIdentifier)
 {
     Assert::isStringOrInteger($adapterIdentifier);
     return in_array($adapterIdentifier, $this->mappingKeys, false);
 }
コード例 #3
0
ファイル: Container.php プロジェクト: brickoo/components
 /**
  * Removes the container entry by its key.
  * @param string|integer $key
  * @throws \InvalidArgumentException
  * @return \Brickoo\Component\Common\Container
  */
 public function remove($key)
 {
     Assert::isStringOrInteger($key);
     if ($this->contains($key)) {
         unset($this->container[$key]);
     }
     return $this;
 }
コード例 #4
0
ファイル: AssertTest.php プロジェクト: brickoo/components
 /**
  * @covers Brickoo\Component\Common\Assert::isStringOrInteger
  * @expectedException \InvalidArgumentException
  */
 public function testIsStringOrIntegerThrowsInvalidArgumentException()
 {
     Assert::isStringOrInteger(array("wrongType"));
 }
コード例 #5
0
ファイル: Registry.php プロジェクト: brickoo/components
 /**
  * Check if the identifier is registered.
  * @param string $identifier the identifier to check
  * @return boolean
  */
 public function isRegistered($identifier)
 {
     Assert::isStringOrInteger($identifier);
     return array_key_exists($identifier, $this->registrations);
 }