original_string: public static function get($className, $parentClassName = '')
      {
          $className = self::cleanName($className);
  
          // We store the relationship between class & parent to prevent cyclical references
          if ($parentClassName) {
              self::$relations[$className][$parentClassName] = true;
          }
  
          // And we check for cyclical references to prevent infinite loops
          if ($parentClassName
              && isset(self::$relations[$parentClassName])
              && isset(self::$relations[$parentClassName][$className])
          ) {
              $message  = "Cyclical dependency found: {$className} depends on {$parentClassName}";
              $message .= " but is itself a dependency of {$parentClassName}.";
              throw new \Parable\DI\Exception($message);
          }
  
          if (!self::isStored($className)) {
              self::store(self::create($className, $parentClassName));
          }
  
          return self::$instances[$className];
      }
code: public static function get($className, $parentClassName = '')
      {
          $className = self::cleanName($className);
  
          // We store the relationship between class & parent to prevent cyclical references
          if ($parentClassName) {
              self::$relations[$className][$parentClassName] = true;
          }
  
          // And we check for cyclical references to prevent infinite loops
          if ($parentClassName
              && isset(self::$relations[$parentClassName])
              && isset(self::$relations[$parentClassName][$className])
          ) {
              $message  = "Cyclical dependency found: {$className} depends on {$parentClassName}";
              $message .= " but is itself a dependency of {$parentClassName}.";
              throw new \Parable\DI\Exception($message);
          }
  
          if (!self::isStored($className)) {
              self::store(self::create($className, $parentClassName));
          }
  
          return self::$instances[$className];
      }
code_tokens: public static function get ( $ className , $ parentClassName = '' ) { $ className = self :: cleanName ( $ className ) ; // We store the relationship between class & parent to prevent cyclical references if ( $ parentClassName ) { self :: $ relations [ $ className ] [ $ parentClassName ] = true ; } // And we check for cyclical references to prevent infinite loops if ( $ parentClassName && isset ( self :: $ relations [ $ parentClassName ] ) && isset ( self :: $ relations [ $ parentClassName ] [ $ className ] ) ) { $ message = "Cyclical dependency found: {$className} depends on {$parentClassName}" ; $ message .= " but is itself a dependency of {$parentClassName}." ; throw new \ Parable \ DI \ Exception ( $ message ) ; } if ( ! self :: isStored ( $ className ) ) { self :: store ( self :: create ( $ className , $ parentClassName ) ) ; } return self :: $ instances [ $ className ] ; }
docstring: Return an already instantiated instance or create a new one.
  
  @param string $className
  @param string $parentClassName
  
  @return mixed
  @throws \Parable\DI\Exception
docstring_tokens: Return an already instantiated instance or create a new one .