@penskemediacorp/twig-to-php-parser 0.5.6 → 0.6.4-develop.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/fixtures/template-parts-expected/patterns/components/c-button.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/components/c-byline.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/components/c-heading.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/components/c-logo.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/components/c-nav-link.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/modules/array-key-in-loop.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/modules/breadcrumbs.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/modules/html-tag-interpolation.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/modules/trending.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/objects/o-crap.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/objects/o-nav.php +6 -1
- package/__tests__/fixtures/template-parts-expected/patterns/objects/o-story-list.php +6 -1
- package/lib/twig-to-php-parser.php +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<a class="c-button <?php echo esc_attr( $modifier_class ?? '' ); ?>" href="<?php echo esc_url( $c_button_url ?? '' ); ?>">
|
|
5
10
|
<?php echo esc_html( $c_button_text ?? '' ); ?>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<p class="c-byline <?php echo esc_attr( $modifier_class ?? '' ); ?> <?php echo esc_attr( $c_byline_classes ?? '' ); ?>">
|
|
5
10
|
<?php echo esc_html( $c_byline_by_text ?? '' ); ?>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<h2 class="c-heading <?php echo esc_attr( $modifier_class ?? '' ); ?>"><?php echo esc_html( $c_heading_text ?? '' ); ?></h2>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<div>
|
|
5
10
|
<?php \PMC::render_template( \PMC\Larva\Config::get_instance()->get( 'brand_directory' ) . '/build/svg/' . ( $c_logo_svg ?? '' ) . '.svg', [], true ); ?>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<a class="c-nav-link <?php echo esc_attr( $c_nav_link_classes ?? '' ); ?>" href="<?php echo esc_url( $c_nav_link_url ?? '' ); ?>">
|
|
5
10
|
<?php echo esc_html( $c_nav_link_text ?? '' ); ?>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<?php foreach ( $list_items ?? [] as $item ) { ?>
|
|
5
10
|
<li class="list__item larva // <?php echo esc_attr( $list_item_classes ?? '' ); ?>">
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<?php \PMC\Larva\Pattern::get_instance()->render_pattern_template( 'objects/o-nav', $o_nav, true ); ?>
|
package/__tests__/fixtures/template-parts-expected/patterns/modules/html-tag-interpolation.php
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<<?php echo esc_attr( $list_type_name ?? '' ); ?>l class="list larva // <?php echo esc_attr( $list_classes ?? '' ); ?>">
|
|
5
10
|
<?php foreach ( $list_items ?? [] as $item ) { ?>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<p class="o-crap <?php echo esc_attr( $modifier_class ?? '' ); ?> <?php echo esc_attr( $o_crap_classes ?? '' ); ?>"><?php echo esc_html( $o_crap_text ?? '' ); ?></p>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<nav class="o-nav <?php echo esc_attr( $modifier_class ?? '' ); ?> <?php echo esc_attr( $o_nav_classes ?? '' ); ?>" data-dropdown="<?php echo esc_attr( $o_nav_data_attributes ?? '' ); ?>">
|
|
5
10
|
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generated file.
|
|
4
|
+
*
|
|
5
|
+
* Refer to the relevant Twig file for adjusting this markup.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
?>
|
|
4
9
|
<ul class="o-story-list <?php echo esc_attr( $modifier_class ?? '' ); ?> <?php echo esc_attr( $o_story_list_classes ?? '' ); ?>">
|
|
5
10
|
<?php foreach ( $o_story_list_teases ?? [] as $item ) { ?>
|
|
@@ -216,7 +216,7 @@ function twig_to_php_parser( $patterns_dir_path, $template_dir_path, $is_using_p
|
|
|
216
216
|
$twig_markup_replace_main = parse_wp_action( $twig_markup_replace_main );
|
|
217
217
|
$twig_markup_replace_complete = str_replace( array_keys( (array) $general_replacers ), array_values( $general_replacers ), $twig_markup_replace_main );
|
|
218
218
|
|
|
219
|
-
$php_markup = "<?php\n
|
|
219
|
+
$php_markup = "<?php\n/**\n * Generated file.\n *\n * Refer to the relevant Twig file for adjusting this markup.\n */\n\n?>\n";
|
|
220
220
|
$php_markup .= $twig_markup_replace_complete;
|
|
221
221
|
|
|
222
222
|
if ( ! file_exists( $template_dir ) ) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@penskemediacorp/twig-to-php-parser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.4-develop.17+854eedf7",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "laras126 <laras126@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/penske-media-corp/pmc-larva#readme",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"chalk": "^4.1.0",
|
|
27
27
|
"exec-php": "0.0.5"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "854eedf76f31c2ed8f5300329cc2242f936e69b8"
|
|
30
30
|
}
|