File tree Expand file tree Collapse file tree 3 files changed +66
-2
lines changed Expand file tree Collapse file tree 3 files changed +66
-2
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,11 @@ public static function getClassNameFromFile($file)
3434 break ;
3535 }
3636
37- $ buffer .= fread ($ fp , 512 );
38- $ tokens = token_get_all ($ buffer );
37+ // Read entire lines to prevent keyword truncation
38+ for ($ line = 0 ; $ line <= 20 ; $ line ++) {
39+ $ buffer .= fgets ($ fp );
40+ }
41+ $ tokens = @token_get_all ($ buffer );
3942
4043 if (strpos ($ buffer , '{ ' ) === false ) {
4144 continue ;
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ * This file is part of the PHPCR Migrations package
5+ *
6+ * (c) Daniel Leech <daniel@dantleech.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 PHPCR \Migrations \tests \Unit ;
13+
14+ use PHPCR \Migrations \MigratorUtil ;
15+
16+ class MigratorUtilTest extends \PHPUnit_Framework_TestCase
17+ {
18+ /**
19+ * It should return the classname of a file.
20+ */
21+ public function testGetClassName ()
22+ {
23+ $ className = MigratorUtil::getClassNameFromFile (__DIR__ . '/migrations/Version201511240843.php ' );
24+ $ this ->assertEquals ('\Sulu\Bundle\ContentBundle\Version201511240843 ' , $ className );
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ * This file is part of the PHPCR Migrations package
5+ *
6+ * (c) Daniel Leech <daniel@dantleech.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 Sulu \Bundle \ContentBundle ;
13+
14+ use PHPCR \Migrations \VersionInterface ;
15+ use PHPCR \NodeInterface ;
16+ use PHPCR \SessionInterface ;
17+ use Bala \Bundle \ContentBundle \Blog \BasePageBlog ;
18+ use Bala \Bundle \BlogManagerBundle \Bridge \BlogInspector ;
19+ use Bala \Bundle \BlogManagerBundle \Bridge \PropertyEncoder ;
20+ use Bala \Component \Content \Metadata \BlockMetadata ;
21+ use Bala \Component \Content \Metadata \Factory \StructureMetadataFactoryInterface ;
22+ use Bala \Component \Content \Metadata \PropertyMetadata ;
23+ use Bala \Component \Content \Metadata \StructureMetadata ;
24+ use Bala \Component \BlogManager \BlogManagerInterface ;
25+ use Symfony \Component \DependencyInjection \ContainerAwareInterface ;
26+ use Symfony \Component \DependencyInjection \ContainerInterface ;
27+
28+ /**
29+ * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore
30+ *
31+ * Created: 2015-12-10 10:04
32+ */
33+ class Version201511240843 implements VersionInterface, ContainerAwareInterface
34+ {
35+ }
You can’t perform that action at this time.
0 commit comments