2017 © Pedro Peláez
 

package php-parser

This package can parse easily PHP Files. There is a visitor which removes all the PHP comments (NOT the DocBlocks) - including @author and @copyright tags from docblocks.

image

vm5/php-parser

This package can parse easily PHP Files. There is a visitor which removes all the PHP comments (NOT the DocBlocks) - including @author and @copyright tags from docblocks.

  • Tuesday, September 12, 2017
  • by Warxcell
  • Repository
  • 5 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

<?php

use PhpParser\NodeTraverser;
use PhpParser\PrettyPrinter;
use VM5\PhpCommentsRemover\Saver\SameFileSaver;
use VM5\PhpCommentsRemover\Visitor;

require 'vendor/autoload.php';

$parserFactory = new \PhpParser\ParserFactory();

$docBlockFactory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
$serializer = new \phpDocumentor\Reflection\DocBlock\Serializer();

$docBlockVisitors = [
    new \VM5\PhpParser\DocBlockVisitor\CommentsRemoverDocBlockVisitor(),
];

$visitor = new \VM5\PhpParser\NodeVisitor\DocBlockVisitor($docBlockFactory, $serializer, $docBlockVisitors);
$nodeTraverser = new NodeTraverser();
$nodeTraverser->addVisitor($visitor);

$removeComments = new \VM5\PhpCommentsRemover\CommentsRemover(
    $parserFactory->create(\PhpParser\ParserFactory::PREFER_PHP5),
    $traverser,
    new PrettyPrinter\Standard,
    new SameFileSaver()
);

$removeComments->parseDirectory(__DIR__);
$removeComments->parseFile('file.php');

The Versions

12/09 2017

dev-master

9999999-dev

This package can parse easily PHP Files. There is a visitor which removes all the PHP comments (NOT the DocBlocks) - including @author and @copyright tags from docblocks.

  Sources   Download

The Requires

 

by Bozhidar Hristov

php comments comment remove remover