-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unused imports; Use str_starts_with()
function
#1681
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
|
||
namespace CommonsBooking\API\GBFS; | ||
|
||
use Exception; | ||
use stdClass; | ||
use WP_REST_Response; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
namespace CommonsBooking\Map; | ||
|
||
use DateTime; | ||
|
||
class MapFilter { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -408,11 +408,11 @@ public function registerMetabox() { | |
protected function getCustomFields(): array { | ||
// We need static types, because german month names dont't work for datepicker | ||
$dateFormat = 'd/m/Y'; | ||
if ( strpos( get_locale(), 'de_' ) !== false ) { | ||
if ( str_starts_with( get_locale(), 'de_' ) ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gleiche Codedopplung, s.o. |
||
$dateFormat = 'd.m.Y'; | ||
} | ||
|
||
if ( strpos( get_locale(), 'en_' ) !== false ) { | ||
if ( str_starts_with( get_locale(), 'en_' ) ) { | ||
$dateFormat = 'm/d/Y'; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
use CommonsBooking\Model\BookingCode; | ||
use WP_Post; | ||
use Exception; | ||
use CommonsBooking\CB\CB; | ||
use CommonsBooking\View\Calendar; | ||
use CommonsBooking\View\Admin\Filter; | ||
use CommonsBooking\Repository\BookingCodes; | ||
|
@@ -308,6 +307,7 @@ public static function addAdminLocationFilter() { | |
|
||
/** | ||
* Adds filter dropdown // filter by location in booking list | ||
* | ||
*/ | ||
public static function addAdminStatusFilter() { | ||
$values = []; | ||
|
@@ -475,11 +475,11 @@ public function registerMetabox() { | |
protected function getCustomFields() { | ||
// We need static types, because german month names dont't work for datepicker | ||
$dateFormat = 'd/m/Y'; | ||
if ( strpos( get_locale(), 'de_' ) !== false ) { | ||
if ( str_starts_with( get_locale(), 'de_' ) ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s.o. |
||
$dateFormat = 'd.m.Y'; | ||
} | ||
|
||
if ( strpos( get_locale(), 'en_' ) !== false ) { | ||
if ( str_starts_with( get_locale(), 'en_' ) ) { | ||
$dateFormat = 'm/d/Y'; | ||
} | ||
|
||
|
@@ -1410,15 +1410,13 @@ public function initHooks() { | |
// Add custom cmb2 type for email booking codes by cron | ||
add_action( 'cmb2_render_booking_codes_email_fields', [ '\CommonsBooking\View\BookingCodes','renderCronEmailFields' ], 10, 5 ); | ||
add_action( 'cmb2_save_field_' . \CommonsBooking\View\BookingCodes::CRON_EMAIL_CODES, [ '\CommonsBooking\View\BookingCodes','cronEmailCodesSaved' ], 10, 3 ); | ||
|
||
// Add Meta Boxes | ||
add_action( 'cmb2_admin_init', array( $this, 'registerMetabox' ) ); | ||
|
||
// must be 'save_post' only because of priority in relation to cmb2 | ||
add_action( 'save_post', array( $this, 'savePost' ), 11, 2 ); | ||
|
||
add_action( 'updated_post_meta', array( $this, 'updatedPostMeta' ), 11, 4 ); | ||
|
||
// Add type filter to backend list view | ||
add_action( 'restrict_manage_posts', array( self::class, 'addAdminTypeFilter' ) ); | ||
add_action( 'restrict_manage_posts', array( self::class, 'addAdminItemFilter' ) ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das ist gedoppelter Code. Lässt sich das irgendwie sinnvoll auslagern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich persönlich würde das nicht auslagern. Ist eine sehr einfache Operation und taucht auch nur 4 mal im Code auf. Bzw. 8 mal mit den Englischen Vorkommen.