コード例 #1
0
ファイル: DbConfig.php プロジェクト: shabbirvividads/magento2
 /**
  * Constructor
  *
  * @param array $data
  * @throws \InvalidArgumentException
  */
 public function __construct(array $data)
 {
     $this->data = [self::KEY_PREFIX => '', 'connection' => ['default' => [self::KEY_HOST => '', self::KEY_NAME => '', self::KEY_USER => '', self::KEY_PASS => '', self::KEY_MODEL => 'mysql4', self::KEY_INIT_STATEMENTS => 'SET NAMES utf8;', self::KEY_ACTIVE => '1']]];
     $data = $this->update($data);
     $this->checkData($data);
     parent::__construct($data);
 }
コード例 #2
0
 /**
  * Constructor
  *
  * @param array $data
  * @throws \InvalidArgumentException
  */
 public function __construct(array $data)
 {
     if (!isset($data[self::KEY_ENCRYPTION_KEY])) {
         throw new \InvalidArgumentException('No encryption key provided');
     }
     parent::__construct($data);
 }
コード例 #3
0
ファイル: HNHBK.php プロジェクト: mschindler83/fints-hbci-php
 /**
  * HNHBK constructor.
  * @param string $messageLength
  * @param string $dialogId
  * @param int $messageNumber
  */
 public function __construct($messageLength, $dialogId, $messageNumber)
 {
     if (strlen($messageLength) != 12) {
         $messageLength = str_pad((int) $messageLength + static::HEADER_LENGTH + strlen($dialogId) + strlen($messageNumber), 12, '0', STR_PAD_LEFT);
     }
     parent::__construct(static::NAME, 1, static::VERSION, array($messageLength, 300, $dialogId, $messageNumber));
 }
コード例 #4
0
ファイル: AbstractSegment.php プロジェクト: omines/semver
 /**
  * @param AbstractSegment $that
  * @return integer|double Negative is this is smaller, positive if that is smaller, or 0 if equals.
  */
 public function compare(AbstractSegment $that)
 {
     $thoseElements = count($that->elements);
     $theseElements = count($this->elements);
     if (!$thoseElements || !$theseElements) {
         return count($that->elements) - count($this->elements);
     } elseif ($thoseElements > $theseElements) {
         return -$that->compare($this);
     }
     foreach ($this->elements as $key => $value) {
         if ($result = $this->compareElements($value, $that[$key])) {
             return $result;
         }
     }
     return 0;
 }
コード例 #5
0
 /**
  * Constructor
  *
  * @param array $data
  * @throws \InvalidArgumentException
  */
 public function __construct(array $data)
 {
     if (!isset($data[self::KEY_DATE])) {
         throw new \InvalidArgumentException('Install date not provided');
     }
     parent::__construct($data);
 }
コード例 #6
0
 /**
  * Constructor
  *
  * @param array $data
  * @throws \InvalidArgumentException
  */
 public function __construct(array $data = [])
 {
     $this->data = ['default_setup' => [self::KEY_CONNECTION => 'default']];
     if (!$this->validate($data)) {
         throw new \InvalidArgumentException('Invalid resource configuration.');
     }
     parent::__construct($this->update($data));
 }
コード例 #7
0
 /**
  * Constructor
  *
  * @param array $data
  * @throws \InvalidArgumentException
  */
 public function __construct(array $data)
 {
     if (!isset($data[self::KEY_SAVE])) {
         $data = [self::KEY_SAVE => 'files'];
     } elseif ($data[self::KEY_SAVE] !== 'files' && $data[self::KEY_SAVE] !== 'db') {
         throw new \InvalidArgumentException("Invalid session_save location {$data[self::KEY_SAVE]}");
     }
     parent::__construct($data);
 }
コード例 #8
0
 /**
  * Constructor
  *
  * @param array $data
  * @throws \InvalidArgumentException
  */
 public function __construct(array $data)
 {
     if (empty($data[self::KEY_FRONTNAME])) {
         throw new \InvalidArgumentException("No backend frontname provided.");
     }
     if (!preg_match('/^[a-zA-Z0-9_]+$/', $data[self::KEY_FRONTNAME])) {
         throw new \InvalidArgumentException("Invalid backend frontname {$data[self::KEY_FRONTNAME]}");
     }
     parent::__construct($data);
 }
コード例 #9
0
ファイル: Path.php プロジェクト: ngreimel/kovent
 /**
  * {@inheritdoc}
  */
 protected function formatRemoveSegment($data)
 {
     return array_map('urldecode', parent::formatRemoveSegment($data));
 }
コード例 #10
0
ファイル: HKSYN.php プロジェクト: mschindler83/fints-hbci-php
 /**
  * HKSYN constructor.
  * @param int $segmentNumber
  * @param int $syncMode
  */
 public function __construct($segmentNumber, $syncMode = self::SYNC_MODE_NEW_CUSTOMER_ID)
 {
     parent::__construct(static::NAME, $segmentNumber, static::VERSION, array($syncMode));
 }
コード例 #11
0
 /**
  * Constructor
  *
  * @param array $data
  */
 public function __construct(array $data)
 {
     $this->validate($data);
     parent::__construct($data);
 }
コード例 #12
0
ファイル: HKVVB.php プロジェクト: mschindler83/fints-hbci-php
 /**
  * HKVVB constructor.
  * @param int $segmentNumber
  * @param int $bpdVersion
  * @param int $updVersion
  * @param int $dialogLanguage
  * @param string $productName
  * @param string $productVersion
  */
 public function __construct($segmentNumber, $bpdVersion = self::DEFAULT_BPD_VERSION, $updVersion = self::DEFAULT_UPD_VERSION, $dialogLanguage = self::LANG_DEFAULT, $productName = self::DEFAULT_PRODUCT_NAME, $productVersion = self::DEFAULT_PRODUCT_VERSION)
 {
     parent::__construct(static::NAME, $segmentNumber, static::VERSION, array($bpdVersion, $updVersion, $dialogLanguage, $productName, $productVersion));
 }
コード例 #13
0
ファイル: HKSAL.php プロジェクト: mschindler83/fints-hbci-php
 /**
  * HKSAL constructor.
  * @param int $version
  * @param int $segmentNumber
  * @param mixed $ktv
  * @param array $allAccounts
  */
 public function __construct($version, $segmentNumber, $ktv, $allAccounts)
 {
     parent::__construct(static::NAME, $segmentNumber, $version, array($ktv, $allAccounts));
 }
コード例 #14
0
ファイル: HKEND.php プロジェクト: mschindler83/fints-hbci-php
 /**
  * HKEND constructor.
  * @param $segmentNumber
  * @param $dialogId
  */
 public function __construct($segmentNumber, $dialogId)
 {
     parent::__construct(static::NAME, $segmentNumber, static::VERSION, array($dialogId));
 }