Append a class to a file and save it
If no file is created the name of the class is the filename

@param PhpClass $class
182955
private function saveClassToFile(PhpClass $class)
    {
        if ($this->isValidClass($class)) {
            $file = new PhpFile($class->getIdentifier());

            $namespace = $this->config->get('namespaceName');
            if (!empty($namespace)) {
                $file->addNamespace($namespace);
            }

            $file->addClass($class);
            $file->save($this->dir);
        }
    }
620943
static function autoload($class)
	{
		$root = explode('\\', trim($class, '\\'), 2);
		if (count($root) > 1 and isset(self::$namespaces[$root[0]]))
		{
            include self::$namespaces[$root[0]].'/'.str_replace('\\', '/', $root[1]).'.php';
		}
	}
39241
public static function autoload($class)
  {
    if(substr($class, 0, strlen(__CLASS__)) != __CLASS__) return;

    try
    {
      self::loadClass($class);

      return TRUE;
    }
    catch(Exception $e)
    {
      return FALSE;
    }
  }
603798
final public static function autoload($class)
    {
        if (version_compare(PHP_VERSION, '5.3', '>=') && __NAMESPACE__) {
            $class = str_replace(__NAMESPACE__, 'PHPTAL', $class);
            $class = strtr($class, '\\', '_');
        }

        if (substr($class, 0, 7) !== 'PHPTAL_') return;

        $path = dirname(__FILE__) . strtr("_".$class, "_", DIRECTORY_SEPARATOR) . '.php';

        require $path;
    }
1228281
public function save($filename, $class = 'File') {
    if(!empty($this->pdf->getError())) {
      throw new Exception('Could not create PDF: ' . $this->pdf->getError());
    } else {
      $filename = rtrim($class::create()->setName($filename), '.pdf') . '.pdf';
      $this->pdf->saveAs($this->folder . $filename);
      return $this->createFile($filename, $class);
    }
  }
318954
public function setClass($class)
    {
        foreach ($this->results as $name) {
            $this->columns->offsetGet($name)->setClass($class);
        }
    }
781928
private function add(string $name, string $class, string $table = null) : bool
  {
    $seeds = ModulusCLI::$appdir . 'database' . DIRECTORY_SEPARATOR . 'seeds';
    $seed = $seeds . DIRECTORY_SEPARATOR . $name . '.php';

    ModulusCLI::_dir($seeds);

    $content = Template::asset('seeder_template');
    $content = str_replace('{name}', $class, $content);
    $content = str_replace('{table_name}', $table, $content);

    if (file_exists($seed)) {
      return false;
    }
    else {
      file_put_contents($seed, $content);
      return true;
    }
  }
1007849
public function addClass(string $class): self
    {
        $classes = explode(' ', $class);

        foreach ($classes as $class) {
            if (!in_array($class, $this->rowClasses)) {
                $this->rowClasses[] = $class;
            }
        }

        return $this;
    }
709122
public static function initializeClass($class)
    {
        try
        {
            // Get a static method named 'initialize'. If not found,
            // ReflectionMethod() will throw a ReflectionException.
            $ref = new \ReflectionMethod($class, 'initialize');

            // The 'initialize' method is probably 'private'.
            // Make it accessible before calling 'invoke'.
            // Note that 'setAccessible' is not available
            // before PHP version 5.3.2.
            $ref->setAccessible(true);

            // Execute the 'initialize' method.
            $ref->invoke(null);
        }
        catch (Exception $e)
        {
        }
    }
384137
private function autoload($class)
    {
        $class = str_replace('main\\', '', $class);
        //var_dump($class );
        $file = realpath(dirname($this->appPath . '/../../')) . '/' . $class . '.php';
        $file = str_replace(['\\', '//'], ['/', '/'], $file);
        //var_dump($file );
        if (is_file($file)) {
            include_once $file;
            return;
        }
    }
1161183
public static function autoloader($class) {
		// Check that the class starts with "Requests"
		if (strpos($class, 'Requests') !== 0) {
			return;
		}

		$file = str_replace('_', '/', $class);
		if (file_exists(dirname(__FILE__) . '/' . $file . '.php')) {
			require_once(dirname(__FILE__) . '/' . $file . '.php');
		}
	}
81955
public function add($class = null)
        {
            $class = $this->getClass($class);

            if (!Arrays::exists($class, $this->reflections)) {
                $this->reflections[$class] = new ReflectionClass($class);
            }

            return $this;
        }
761272
public function addClass($class)
    {
        if (is_array($class)) {
            foreach ($class as $c) {
                $this->addClass($class);
            }

            return $this;
        }
        $this->template->append('class', ' '.$class);

        return $this;
    }
432795
public function addClass($class): self
    {
        $class = Str::toString($class);

        $classes = array_filter(explode(' ', $class), 'strlen');

        $this->classList->add(...$classes);

        return $this;
    }
772924
public function addClass($className)
    {
        $attr = $this->getAttribute('class');
        if ($attr != '') {
            $attr .= ' ';
        }
        $attr .= (string) $className;

        $this->setAttribute('class', $attr);
    }
397716
public static function addCssClass(&$options, $class)
    {
        if (isset($options['class'])) {
            $classes = ' ' . $options['class'] . ' ';
            if (($pos = strpos($classes, ' ' . $class . ' ')) === false) {
                $options['class'] .= ' ' . $class;
            }
        } else {
            $options['class'] = $class;
        }
    }
1054267
public function addClass($class)
    {
        $current = preg_split('%\s+%', $this->getAttribute('class'), 0, PREG_SPLIT_NO_EMPTY);
        $added = preg_split('%\s+%', $class, 0, PREG_SPLIT_NO_EMPTY);
        $current = array_merge($current, $added);
        $classes = implode(' ', $current);

        $this->setAttribute('class', $classes);
    }