@param string $heardAboutUs

@throws \InvalidArgumentException

@return Registration
351041
public function setHeardAboutUs($heardAboutUs)
    {
        if (!is_string($heardAboutUs) && !is_null($heardAboutUs)) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not a string');
        }

        $this->heardAboutUs = $heardAboutUs;

        return $this;
    }
511413
protected function areArgumentsValid($args, array $accepted)
    {
        if ($args == null)
        {
            return;
        }

        foreach ($accepted as $accept)
        {
            if (array_key_exists($accept, $args))
            {
                return true;
            }
        }

        throw new \InvalidArgumentException('This call only accepts these arguments: ' . implode(" | ",$accepted));
    }
1042230
public function addFixture(FixtureInterface $fixture)
    {
        $fixtureClass = get_class($fixture);

        if (!isset($this->fixtures[$fixtureClass])) {
            if ($fixture instanceof OrderedFixtureInterface && $fixture instanceof DependentFixtureInterface) {
                throw new \InvalidArgumentException(sprintf('Class "%s" can\'t implement "%s" and "%s" at the same time.', 
                    get_class($fixture),
                    'OrderedFixtureInterface',
                    'DependentFixtureInterface'));
            }

            $this->fixtures[$fixtureClass] = $fixture;

            if ($fixture instanceof OrderedFixtureInterface) {
                $this->orderFixturesByNumber = true;
            } elseif ($fixture instanceof DependentFixtureInterface) {
                $this->orderFixturesByDependencies = true;
                foreach($fixture->getDependencies() as $class) {
                    if (class_exists($class)) {
                        $this->addFixture($this->createFixture($class));
                    }
                }
            }
        }
    }
495658
protected function registerHomer()
    {
        $this->app->singleton('homer', function ($app) {
            return new HomerManager($app, $app['homer.context'], $app['homer.dispatcher'], $app['config']['homer']);
        });
    }
985185
public function confirmedAction()
    {
        $user = $this->getUser();
        if (!is_object($user) || !$user instanceof UserInterface) {
            throw new AccessDeniedException('This user does not have access to this section.');
        }

        return $this->render('silex_user/registration/confirmed.twig', [
            'user' => $user
        ]);
    }
884057
public function setPublished(string $published = "F") : CNabuDataObject
    {
        if ($published === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$published")
            );
        }
        $this->setValue('nb_site_published', $published);
        
        return $this;
    }
1226609
public function setDefaultTargetUseURI(string $default_target_use_uri = "N") : CNabuDataObject
    {
        if ($default_target_use_uri === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$default_target_use_uri")
            );
        }
        $this->setValue('nb_site_default_target_use_uri', $default_target_use_uri);
        
        return $this;
    }
759783
public function setAliasNotFoundTargetUseURI(string $alias_not_found_target_use_uri = "N") : CNabuDataObject
    {
        if ($alias_not_found_target_use_uri === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$alias_not_found_target_use_uri")
            );
        }
        $this->setValue('nb_site_alias_not_found_target_use_uri', $alias_not_found_target_use_uri);
        
        return $this;
    }
975679
public function on(string $event, callable $cb, bool $replace = false)
    {
        if (false === ($key = array_search($event, $this->getSupportedEvents(), true))) {
            $sup = implode(',', $this->getSupportedEvents());

            throw new \InvalidArgumentException("The want registered event [$event] is not supported. Supported: $sup");
        }

        // init property
        if ($this->eventHandlers === null) {
            $this->eventHandlers = new \SplFixedArray(\count($this->getSupportedEvents()));
        }

        if (!$replace && isset($this->eventHandlers[$key])) {
            throw new \InvalidArgumentException("The want registered event [$event] have been registered! don't allow replace.");
        }

        $this->eventHandlers[$key] = $cb;
    }
114584
protected function registerReminderRepository()
	{
		$this->app->bindShared('auth.reminder.repository', function($app)
		{
			$connection = $app['db']->connection();

			// The database reminder repository is an implementation of the reminder repo
			// interface, and is responsible for the actual storing of auth tokens and
			// their e-mail addresses. We will inject this table and hash key to it.
			$table = $app['config']['auth.reminder.table'];

			$key = $app['config']['app.key'];

			$expire = $app['config']->get('auth.reminder.expire', 60);

			return new DbRepository($connection, $table, $key, $expire);
		});
	}
516754
public function setSentVia($sentVia)
    {
        if (is_string($sentVia) && in_array($sentVia, self::$sentVias)) {
            $this->sentVia = $sentVia;
        } else {
            throw new InvalidArgumentException;
        }
    }
1106571
public static function register(
        string $metadataDir,
        string $metadataNamespace,
        ?callable $notFoundCallback = null
    ) : Closure {
        $metadataNamespace = ltrim($metadataNamespace, '\\');

        if (! ($notFoundCallback === null || is_callable($notFoundCallback))) {
            $type = is_object($notFoundCallback) ? get_class($notFoundCallback) : gettype($notFoundCallback);

            throw new InvalidArgumentException(
                sprintf('Invalid \$notFoundCallback given: must be a callable, "%s" given', $type)
            );
        }

        $autoloader = static function ($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) {
            if (strpos($className, $metadataNamespace) === 0) {
                $file = Autoloader::resolveFile($metadataDir, $metadataNamespace, $className);

                if ($notFoundCallback && ! file_exists($file)) {
                    call_user_func($notFoundCallback, $metadataDir, $metadataNamespace, $className);
                }

                require $file;
            }
        };

        spl_autoload_register($autoloader);

        return $autoloader;
    }
1310237
public function redirect($location, $temporarily = true)
    {
        if ($temporarily) {
            $this->setStatus(302, 'Temporarily Moved');
        } else {
            $this->setStatus(301, 'Permanently Moved');
        }

        $this->setHeader('Location', $this->url->get($location));

        throw new AbortException();

        /** @noinspection PhpUnreachableStatementInspection */
        return $this;
    }
1007673
public function register($name, $instance)
    {
        if (!is_string($name)) {
            throw new InvalidArgumentException(sprintf(
                'Argument #1 $name must be a string, received "%s"', gettype($name)
            ));
        }

        $this->container[$name] = $instance;
        return $this;
    }
342997
public function registration()
    {
        /**
         * @var Config $settings
         */
        if ($this->getDI() === null) {
            throw new DiNotFoundException("DI can't be found.");
        }

        $creator = new Creator($this->di);

        foreach ($this->services as $name => $settings) {
            $creator->setService($settings);
            $service = $creator->injection();

            if ($service !== null) {
                $call = $settings->get('shared') ? 'setShared' : 'set';
                $this->getDI()->$call($name, $service);
            }
        }
        $this->services = null;
    }
1156676
public function addInstaller(InstallerInterface $installer)
    {
        $installerClass = get_class($installer);

        if (!isset($this->installers[$installerClass])) {
            if ($installer instanceof OrderedInstallerInterface && $installer instanceof DependentInstallerInterface) {
                throw new \InvalidArgumentException(sprintf('Class "%s" can\'t implement "%s" and "%s" at the same time.',
                    $installerClass,
                    'OrderedInstallerInterface',
                    'DependentInstallerInterface'));
            } elseif ($installer instanceof OrderedInstallerInterface) {
                $this->orderInstallersByNumber = true;
            } elseif ($installer instanceof DependentInstallerInterface) {
                $this->orderInstallersByDependencies = true;
                foreach ($installer->getDependencies() as $class) {
                    $this->addInstaller(new $class);
                }
            }

            $this->installers[$installerClass] = $installer;
        }
    }
239254
public static function register( int $linuxNumber, string $logic = Logic::ACTIVE_HIGH ): GPO {
		GPIO::checkLogic( $logic );
		$gpo = new GPO( $linuxNumber, $logic );

		// Features
		$gpo->export();
		$gpo->setDirection();
		$gpo->setLogic( $logic );

		// Reset to be sure of the state at start
		$gpo->reset();

		return $gpo;
	}