Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

EmptyGuardTrait.php

Zuletzt modifiziert: 09.10.2024, 12:57 - Dateigröße: 1009.00 Bytes


 01  <?php
 02  /**
 03   * Zend Framework (http://framework.zend.com/)
 04   *
 05   * @link      http://github.com/zendframework/zf2 for the canonical source repository
 06   * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 07   * @license   http://framework.zend.com/license/new-bsd New BSD License
 08   */
 09   
 10  namespace Zend\Stdlib\Guard;
 11   
 12  /**
 13   * Provide a guard method against empty data
 14   */
 15  trait EmptyGuardTrait
 16  {
 17      /**
 18       * Verify that the data is not empty
 19       *
 20       * @param  mixed  $data           the data to verify
 21       * @param  string $dataName       the data name
 22       * @param  string $exceptionClass FQCN for the exception
 23       * @throws \Exception
 24       */
 25      protected function guardAgainstEmpty(
 26          $data,
 27          $dataName = 'Argument',
 28          $exceptionClass = 'Zend\Stdlib\Exception\InvalidArgumentException'
 29      ) {
 30          if (empty($data)) {
 31              $message = sprintf('%s cannot be empty', $dataName);
 32              throw new $exceptionClass($message);
 33          }
 34      }
 35  }
 36