Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • ArrayNode
  • BaseNode
  • BooleanNode
  • EnumNode
  • FloatNode
  • IntegerNode
  • NumericNode
  • Processor
  • PrototypedArrayNode
  • ReferenceDumper
  • ScalarNode
  • VariableNode

Interfaces

  • ConfigurationInterface
  • NodeInterface
  • PrototypeNodeInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: /*
 4:  * This file is part of the Symfony package.
 5:  *
 6:  * (c) Fabien Potencier <fabien@symfony.com>
 7:  *
 8:  * For the full copyright and license information, please view the LICENSE
 9:  * file that was distributed with this source code.
10:  */
11: 
12: namespace Symfony\Component\Config\Definition;
13: 
14: use Symfony\Component\Config\Definition\VariableNode;
15: use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
16: 
17: /**
18:  * This node represents a scalar value in the config tree.
19:  *
20:  * The following values are considered scalars:
21:  *   * booleans
22:  *   * strings
23:  *   * null
24:  *   * integers
25:  *   * floats
26:  *
27:  * @author Johannes M. Schmitt <schmittjoh@gmail.com>
28:  */
29: class ScalarNode extends VariableNode
30: {
31:     /**
32:      * {@inheritDoc}
33:      */
34:     protected function validateType($value)
35:     {
36:         if (!is_scalar($value) && null !== $value) {
37:             $ex = new InvalidTypeException(sprintf(
38:                 'Invalid type for path "%s". Expected scalar, but got %s.',
39:                 $this->getPath(),
40:                 gettype($value)
41:             ));
42:             $ex->setPath($this->getPath());
43: 
44:             throw $ex;
45:         }
46:     }
47: }
48: 
php-coveralls API documentation generated by ApiGen 2.8.0