Skip to content

Commit

Permalink
Fix lint rule violations
Browse files Browse the repository at this point in the history
  • Loading branch information
atanas-dev committed Oct 28, 2018
1 parent 5cf3784 commit 6641962
Show file tree
Hide file tree
Showing 21 changed files with 101 additions and 110 deletions.
1 change: 1 addition & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function register() {

$file = get_theme_file_path( 'dist/mix-manifest.json' );

// @codingStandardsIgnoreLine WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
return file_exists( $file ) ? json_decode( file_get_contents( $file ), true ) : null;
} );
}
Expand Down
4 changes: 2 additions & 2 deletions app/bootstrap-compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function mythic_compat_message() {

return sprintf(
// Translators: 1 is the required WordPress version and 2 is the user's current version.
__( 'Mythic requires at least WordPress version %1$s. You are running version %2$s. Please upgrade and try again.' ),
__( 'Mythic requires at least WordPress version %1$s. You are running version %2$s. Please upgrade and try again.', 'mythic' ),
'4.9.6',
$GLOBALS['wp_version']
);
Expand All @@ -43,7 +43,7 @@ function mythic_compat_message() {

return sprintf(
// Translators: 1 is the required PHP version and 2 is the user's current version.
__( 'Mythic requires at least PHP version %1$s. You are running version %2$s. Please upgrade and try again.' ),
__( 'Mythic requires at least PHP version %1$s. You are running version %2$s. Please upgrade and try again.', 'mythic' ),
'5.6',
PHP_VERSION
);
Expand Down
28 changes: 14 additions & 14 deletions app/functions-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@
// `resources/scss/settings/_colors.scss` file.
add_theme_support( 'editor-color-palette', [
[
'name' => __( 'Charcoal' ),
'name' => __( 'Charcoal', 'mythic' ),
'slug' => 'charcoal',
'color' => '#282c34'
],
[
'name' => __( 'Regent' ),
'name' => __( 'Regent', 'mythic' ),
'slug' => 'regent',
'color' => '#8c97a7',
],
[
'name' => __( 'Husk' ),
'name' => __( 'Husk', 'mythic' ),
'slug' => 'husk',
'color' => '#B9A364',
],
[
'name' => __( 'Red Stage' ),
'name' => __( 'Red Stage', 'mythic' ),
'slug' => 'red-stage',
'color' => '#b15330',
]
Expand All @@ -102,26 +102,26 @@
// `resources/scss/settings/_fonts.scss` file.
add_theme_support( 'editor-font-sizes', [
[
'name' => __( 'Small' ),
'shortName' => __( 'S' ),
'name' => __( 'Small', 'mythic' ),
'shortName' => __( 'S', 'mythic' ),
'size' => 12,
'slug' => 'small'
],
[
'name' => __( 'Regular' ),
'shortName' => __( 'M' ),
'name' => __( 'Regular', 'mythic' ),
'shortName' => __( 'M', 'mythic' ),
'size' => 16,
'slug' => 'regular'
],
[
'name' => __( 'Large' ),
'shortName' => __( 'L' ),
'name' => __( 'Large', 'mythic' ),
'shortName' => __( 'L', 'mythic' ),
'size' => 36,
'slug' => 'large'
],
[
'name' => __( 'Larger' ),
'shortName' => __( 'XL' ),
'name' => __( 'Larger', 'mythic' ),
'shortName' => __( 'XL', 'mythic' ),
'size' => 48,
'slug' => 'larger'
]
Expand Down Expand Up @@ -201,7 +201,7 @@
add_action( 'init', function() {

register_nav_menus( [
'primary' => esc_html_x( 'Primary', 'nav menu location' )
'primary' => esc_html_x( 'Primary', 'nav menu location', 'mythic' )
] );

}, 5 );
Expand Down Expand Up @@ -248,7 +248,7 @@

register_sidebar( [
'id' => 'primary',
'name' => esc_html_x( 'Primary', 'sidebar' )
'name' => esc_html_x( 'Primary', 'sidebar', 'mythic' )
] + $args );

}, 5 );
2 changes: 1 addition & 1 deletion app/functions-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function sep( $sep = '' ) {
'mythic/sep',
sprintf(
' <span class="sep">%s</span> ',
$sep ?: esc_html_x( '&middot;', 'meta separator' )
$sep ?: esc_html_x( '&middot;', 'meta separator', 'mythic' )
)
);
}
12 changes: 6 additions & 6 deletions resources/scss/blocks/core/_file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
padding: 0.5em 1em;
text-decoration: none;

// Give the file block button some spacing to the left if there's
// another element preceding it.
* + & {
margin-left: 0.75em;
}

&:hover,
&:visited,
&:focus,
Expand All @@ -33,9 +39,3 @@
}
}
}

// Give the file block button some spacing to the left if there's another element
// preceding it.
* + .wp-block-file__button {
margin-left: 0.75em;
}
54 changes: 23 additions & 31 deletions resources/scss/blocks/core/_gallery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,21 @@
flex-direction: column;
justify-content: center;
position: relative;
// Fallback to 2 columns.
width: calc( 100% / 2 - 16px );

// 1 column.
.columns-1 & {
width: calc( 100% / 1 - 16px );
}

// Image figure.
figure {
margin: 0;
height: 100%;

// IE11 doesn't support flex and can't read this.
@supports( position: sticky ) {
@supports ( position: sticky ) {
display: flex;
align-items: flex-end;
justify-content: flex-start;
Expand All @@ -46,7 +53,7 @@
width: 100%;

// IE11 can't read this.
@supports( position: sticky ) {
@supports ( position: sticky ) {
width: auto;
}
}
Expand All @@ -59,45 +66,30 @@
padding: 40px 10px 5px;
text-align: center;
color: color( white );
background: linear-gradient(
0deg,
rgba( color( black ), 0.7 ) 0,
rgba( color( black ), 0.3 ) 60%,
transparent
);
background: linear-gradient( 0deg, rgba( color( black ), 0.7 ) 0, rgba( color( black ), 0.3 ) 60%, transparent );

img {
display: inline;
}
}
}

// Cropped images.
.is-cropped .blocks-gallery-item {
a,
img {
flex: 1;
width: 100%;

// IE11 doesn't support object-fit.
@supports( position: sticky ) {
flex: 1;
height: 100%;
object-fit: cover;
// Cropped images.
.is-cropped & {
a,
img {
flex: 1;
width: 100%;

// IE11 doesn't support object-fit.
@supports ( position: sticky ) {
flex: 1;
height: 100%;
object-fit: cover;
}
}
}
}

// Fallback to 2 columns.
.blocks-gallery-item {
width: calc( 100% / 2 - 16px );
}

// 1 column.
.columns-1 .blocks-gallery-item {
width: calc( 100% / 1 - 16px );
}

// 3-8 columns on larger screens.
@media ( min-width: break( small ) ) {

Expand Down
2 changes: 0 additions & 2 deletions resources/scss/blocks/core/_image.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,4 @@
max-width: none;
}
}

figcaption {}
}
10 changes: 5 additions & 5 deletions resources/scss/utilities/_alignment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// Left alignment.
.alignleft {
@media( min-width: content-width() / 2 ) {
@media ( min-width: content-width() / 2 ) {
float: left;
margin: 0 1.5rem 1.5rem 0;
max-width: 50%;
Expand All @@ -20,7 +20,7 @@

// Right alignment.
.alignright {
@media( min-width: content-width() / 2 ) {
@media ( min-width: content-width() / 2 ) {
float: left;
margin: 0 0 1.5rem 1.5rem;
max-width: 50%;
Expand All @@ -40,16 +40,16 @@
.alignfull,
.alignwide {
margin-left : calc( -100vw / 2 + 100% / 2 );
margin-right : calc( -100vw / 2 + 100% / 2 );
margin-right : calc( -100vw / 2 + 100% / 2 );
width: auto;
max-width: 100vw;
}

@media( min-width: content-width() ) {
@media ( min-width: content-width() ) {

.alignwide {
margin-left : -25%;
margin-right : -25%;
max-width : calc( #{ content-width() } + 50% );
}
}
}
2 changes: 1 addition & 1 deletion resources/scss/utilities/_media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ img.emoji {
display: inline;
width: 1em;
height: 1em;
margin: 0 .07em;
margin: 0 0.07em;
padding: 0;
vertical-align: -0.1em;
background: none;
Expand Down
4 changes: 2 additions & 2 deletions resources/views/comment/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<?php Hybrid\Comment\display_permalink( [
'text' => sprintf(
// Translators: 1 is the comment date and 2 is the time.
esc_html__( '%1$s at %2$s' ),
esc_html__( '%1$s at %2$s', 'mythic' ),
Hybrid\Comment\render_date(),
Hybrid\Comment\render_time()
)
Expand All @@ -21,7 +21,7 @@
<?php if ( ! Hybrid\Comment\is_approved() ) : ?>

<p class="comment__moderation">
<?php esc_html_e( 'Your comment is awaiting moderation.' ) ?>
<?php esc_html_e( 'Your comment is awaiting moderation.', 'mythic' ) ?>
</p>

<?php endif ?>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/comment/ping.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<?php Hybrid\Comment\display_permalink( [
'text' => sprintf(
// Translators: 1 is the comment date and 2 is the time.
esc_html__( '%1$s at %2$s' ),
esc_html__( '%1$s at %2$s', 'mythic' ),
Hybrid\Comment\render_date(),
Hybrid\Comment\render_time()
)
Expand Down
2 changes: 1 addition & 1 deletion resources/views/comments/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<?php if ( ! comments_open() ) : ?>

<p class="comments__closed">
<?php esc_html_e( 'Comments are closed.' ) ?>
<?php esc_html_e( 'Comments are closed.', 'mythic' ) ?>
</p>

<?php endif ?>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/content/404.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

<div class="entry entry--error">

<h1 class="entry__title"><?php esc_html_e( 'Whoah, partner!' ) ?></h1>
<h1 class="entry__title"><?php esc_html_e( 'Whoah, partner!', 'mythic' ) ?></h1>

<div class="entry__content">
<p><?php esc_html_e( 'It looks like you stumbled upon a page that does not exist. Perhaps rolling the dice with a search might help.' ) ?></p>
<p><?php esc_html_e( 'It looks like you stumbled upon a page that does not exist. Perhaps rolling the dice with a search might help.', 'mythic' ) ?></p>

<?php get_search_form() ?>
</div>
Expand Down
22 changes: 11 additions & 11 deletions resources/views/entry/single/attachment-audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@

<div class="media-meta media-meta--audio">

<h3 class="media-meta__title"><?php esc_html_e( 'Audio Info' ) ?></h3>
<h3 class="media-meta__title"><?php esc_html_e( 'Audio Info', 'mythic' ) ?></h3>

<ul class="media-meta__items">
<?php Hybrid\Media\display_meta( 'length_formatted', [ 'tag' => 'li', 'label' => __( 'Run Time' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'artist', [ 'tag' => 'li', 'label' => __( 'Artist' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'album', [ 'tag' => 'li', 'label' => __( 'Album' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'track_number', [ 'tag' => 'li', 'label' => __( 'Track Number' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'year', [ 'tag' => 'li', 'label' => __( 'Year' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'genre', [ 'tag' => 'li', 'label' => __( 'Genre' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'file_name', [ 'tag' => 'li', 'label' => __( 'Name' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'mime_type', [ 'tag' => 'li', 'label' => __( 'Mime Type' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'file_type', [ 'tag' => 'li', 'label' => __( 'Type' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'file_size', [ 'tag' => 'li', 'label' => __( 'Size' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'length_formatted', [ 'tag' => 'li', 'label' => __( 'Run Time', 'mythic' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'artist', [ 'tag' => 'li', 'label' => __( 'Artist', 'mythic' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'album', [ 'tag' => 'li', 'label' => __( 'Album', 'mythic' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'track_number', [ 'tag' => 'li', 'label' => __( 'Track Number', 'mythic' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'year', [ 'tag' => 'li', 'label' => __( 'Year', 'mythic' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'genre', [ 'tag' => 'li', 'label' => __( 'Genre', 'mythic' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'file_name', [ 'tag' => 'li', 'label' => __( 'Name', 'mythic' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'mime_type', [ 'tag' => 'li', 'label' => __( 'Mime Type', 'mythic' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'file_type', [ 'tag' => 'li', 'label' => __( 'Type', 'mythic' ) ] ) ?>
<?php Hybrid\Media\display_meta( 'file_size', [ 'tag' => 'li', 'label' => __( 'Size', 'mythic' ) ] ) ?>
</ul>

</div>
Expand Down
Loading

0 comments on commit 6641962

Please sign in to comment.