style: auto-fix PHPCS violations via phpcbf

This commit is contained in:
peptiderepo
2026-06-16 15:26:16 +00:00
parent 08d7696444
commit b9158d7dca
45 changed files with 1018 additions and 658 deletions

View File

@@ -24,11 +24,11 @@ class PR_Core_Seed_Data {
$dosing = self::seed_dosing_rows( $peptide_ids );
$legal = self::seed_legal_cells( $peptide_ids );
return [
return array(
'peptides' => count( $peptide_ids ),
'dosing_rows' => $dosing,
'legal_cells' => $legal,
];
);
}
/**
@@ -37,8 +37,8 @@ class PR_Core_Seed_Data {
* @return array<string, int> Map of slug => post ID.
*/
private static function seed_peptides(): array {
$peptides = [
[
$peptides = array(
array(
'title' => 'BPC-157',
'slug' => 'bpc-157',
'excerpt' => 'Body Protection Compound-157, a pentadecapeptide derived from human gastric juice.',
@@ -50,8 +50,8 @@ class PR_Core_Seed_Data {
'drugbank_id' => '',
'chembl_id' => '',
'evidence_strength' => 'observational',
],
[
),
array(
'title' => 'Semaglutide',
'slug' => 'semaglutide',
'excerpt' => 'A GLP-1 receptor agonist approved for type 2 diabetes and chronic weight management.',
@@ -63,8 +63,8 @@ class PR_Core_Seed_Data {
'drugbank_id' => 'DB13928',
'chembl_id' => 'CHEMBL3137309',
'evidence_strength' => 'meta-analysis',
],
[
),
array(
'title' => 'TB-500',
'slug' => 'tb-500',
'excerpt' => 'Thymosin Beta-4 fragment, a synthetic peptide used in tissue repair research.',
@@ -76,37 +76,41 @@ class PR_Core_Seed_Data {
'drugbank_id' => '',
'chembl_id' => '',
'evidence_strength' => 'preclinical',
],
];
),
);
$ids = [];
$ids = array();
foreach ( $peptides as $p ) {
$existing = get_posts( [
'post_type' => PR_Core_Peptide_CPT::POST_TYPE,
'name' => $p['slug'],
'posts_per_page' => 1,
'post_status' => 'any',
] );
$existing = get_posts(
array(
'post_type' => PR_Core_Peptide_CPT::POST_TYPE,
'name' => $p['slug'],
'posts_per_page' => 1,
'post_status' => 'any',
)
);
if ( ! empty( $existing ) ) {
$ids[ $p['slug'] ] = $existing[0]->ID;
continue;
}
$post_id = wp_insert_post( [
'post_type' => PR_Core_Peptide_CPT::POST_TYPE,
'post_title' => $p['title'],
'post_name' => $p['slug'],
'post_excerpt' => $p['excerpt'],
'post_status' => 'publish',
'post_content' => '',
] );
$post_id = wp_insert_post(
array(
'post_type' => PR_Core_Peptide_CPT::POST_TYPE,
'post_title' => $p['title'],
'post_name' => $p['slug'],
'post_excerpt' => $p['excerpt'],
'post_status' => 'publish',
'post_content' => '',
)
);
if ( is_wp_error( $post_id ) ) {
continue;
}
foreach ( [ 'display_name', 'aliases', 'molecular_formula', 'molecular_weight', 'cas_number', 'drugbank_id', 'chembl_id', 'evidence_strength' ] as $key ) {
foreach ( array( 'display_name', 'aliases', 'molecular_formula', 'molecular_weight', 'cas_number', 'drugbank_id', 'chembl_id', 'evidence_strength' ) as $key ) {
update_post_meta( $post_id, $key, $p[ $key ] );
}
update_post_meta( $post_id, 'editorial_review_status', 'published' );
@@ -126,21 +130,145 @@ class PR_Core_Seed_Data {
*/
private static function seed_dosing_rows( array $peptide_ids ): int {
$repo = new PR_Core_Dosing_Repository();
$rows = [
$rows = array(
// BPC-157 (4 rows).
[ 'peptide' => 'bpc-157', 'dose_min' => 200, 'dose_max' => 300, 'dose_unit' => 'mcg', 'route' => 'subq', 'frequency' => 'twice daily', 'population' => 'healthy', 'evidence_strength' => 'observational', 'study_title' => 'BPC 157 in wound healing review', 'study_year' => 2021, 'citation_pubmed_id' => '34537800' ],
[ 'peptide' => 'bpc-157', 'dose_min' => 500, 'dose_max' => 500, 'dose_unit' => 'mcg', 'route' => 'subq', 'frequency' => 'daily', 'population' => 'healthy', 'evidence_strength' => 'case-series', 'study_title' => 'Subcutaneous BPC-157 in tendon repair', 'study_year' => 2019, 'citation_pubmed_id' => '30915550' ],
[ 'peptide' => 'bpc-157', 'dose_min' => 10, 'dose_max' => 10, 'dose_unit' => 'mcg', 'route' => 'oral', 'frequency' => 'daily', 'population' => 'animal', 'evidence_strength' => 'preclinical', 'study_title' => 'Oral BPC-157 in rat gastric ulcer model', 'study_year' => 2018, 'citation_pubmed_id' => '29869189' ],
[ 'peptide' => 'bpc-157', 'dose_min' => 250, 'dose_max' => 750, 'dose_unit' => 'mcg', 'route' => 'im', 'frequency' => 'daily', 'population' => 'clinical', 'evidence_strength' => 'case-series', 'study_title' => 'Intramuscular BPC-157 for muscle injuries', 'study_year' => 2020, 'citation_pubmed_id' => '33312000' ],
array(
'peptide' => 'bpc-157',
'dose_min' => 200,
'dose_max' => 300,
'dose_unit' => 'mcg',
'route' => 'subq',
'frequency' => 'twice daily',
'population' => 'healthy',
'evidence_strength' => 'observational',
'study_title' => 'BPC 157 in wound healing review',
'study_year' => 2021,
'citation_pubmed_id' => '34537800',
),
array(
'peptide' => 'bpc-157',
'dose_min' => 500,
'dose_max' => 500,
'dose_unit' => 'mcg',
'route' => 'subq',
'frequency' => 'daily',
'population' => 'healthy',
'evidence_strength' => 'case-series',
'study_title' => 'Subcutaneous BPC-157 in tendon repair',
'study_year' => 2019,
'citation_pubmed_id' => '30915550',
),
array(
'peptide' => 'bpc-157',
'dose_min' => 10,
'dose_max' => 10,
'dose_unit' => 'mcg',
'route' => 'oral',
'frequency' => 'daily',
'population' => 'animal',
'evidence_strength' => 'preclinical',
'study_title' => 'Oral BPC-157 in rat gastric ulcer model',
'study_year' => 2018,
'citation_pubmed_id' => '29869189',
),
array(
'peptide' => 'bpc-157',
'dose_min' => 250,
'dose_max' => 750,
'dose_unit' => 'mcg',
'route' => 'im',
'frequency' => 'daily',
'population' => 'clinical',
'evidence_strength' => 'case-series',
'study_title' => 'Intramuscular BPC-157 for muscle injuries',
'study_year' => 2020,
'citation_pubmed_id' => '33312000',
),
// Semaglutide (4 rows).
[ 'peptide' => 'semaglutide', 'dose_min' => 0.25, 'dose_max' => 0.25, 'dose_unit' => 'mg', 'route' => 'subq', 'frequency' => 'weekly', 'population' => 'clinical', 'evidence_strength' => 'rct-large', 'study_title' => 'SUSTAIN 1: Semaglutide in T2DM', 'study_year' => 2017, 'citation_pubmed_id' => '28930514', 'indication' => 'Type 2 diabetes — initiation dose' ],
[ 'peptide' => 'semaglutide', 'dose_min' => 1.0, 'dose_max' => 1.0, 'dose_unit' => 'mg', 'route' => 'subq', 'frequency' => 'weekly', 'population' => 'clinical', 'evidence_strength' => 'rct-large', 'study_title' => 'SUSTAIN 6: CV outcomes with semaglutide', 'study_year' => 2016, 'citation_pubmed_id' => '27633186', 'indication' => 'Type 2 diabetes — maintenance' ],
[ 'peptide' => 'semaglutide', 'dose_min' => 2.4, 'dose_max' => 2.4, 'dose_unit' => 'mg', 'route' => 'subq', 'frequency' => 'weekly', 'population' => 'clinical', 'evidence_strength' => 'rct-large', 'study_title' => 'STEP 1: Semaglutide 2.4mg for obesity', 'study_year' => 2021, 'citation_pubmed_id' => '33567185', 'indication' => 'Chronic weight management' ],
[ 'peptide' => 'semaglutide', 'dose_min' => 14, 'dose_max' => 14, 'dose_unit' => 'mg', 'route' => 'oral', 'frequency' => 'daily', 'population' => 'clinical', 'evidence_strength' => 'rct-large', 'study_title' => 'PIONEER 1: Oral semaglutide in T2DM', 'study_year' => 2019, 'citation_pubmed_id' => '30924169', 'indication' => 'Type 2 diabetes — oral formulation' ],
array(
'peptide' => 'semaglutide',
'dose_min' => 0.25,
'dose_max' => 0.25,
'dose_unit' => 'mg',
'route' => 'subq',
'frequency' => 'weekly',
'population' => 'clinical',
'evidence_strength' => 'rct-large',
'study_title' => 'SUSTAIN 1: Semaglutide in T2DM',
'study_year' => 2017,
'citation_pubmed_id' => '28930514',
'indication' => 'Type 2 diabetes — initiation dose',
),
array(
'peptide' => 'semaglutide',
'dose_min' => 1.0,
'dose_max' => 1.0,
'dose_unit' => 'mg',
'route' => 'subq',
'frequency' => 'weekly',
'population' => 'clinical',
'evidence_strength' => 'rct-large',
'study_title' => 'SUSTAIN 6: CV outcomes with semaglutide',
'study_year' => 2016,
'citation_pubmed_id' => '27633186',
'indication' => 'Type 2 diabetes — maintenance',
),
array(
'peptide' => 'semaglutide',
'dose_min' => 2.4,
'dose_max' => 2.4,
'dose_unit' => 'mg',
'route' => 'subq',
'frequency' => 'weekly',
'population' => 'clinical',
'evidence_strength' => 'rct-large',
'study_title' => 'STEP 1: Semaglutide 2.4mg for obesity',
'study_year' => 2021,
'citation_pubmed_id' => '33567185',
'indication' => 'Chronic weight management',
),
array(
'peptide' => 'semaglutide',
'dose_min' => 14,
'dose_max' => 14,
'dose_unit' => 'mg',
'route' => 'oral',
'frequency' => 'daily',
'population' => 'clinical',
'evidence_strength' => 'rct-large',
'study_title' => 'PIONEER 1: Oral semaglutide in T2DM',
'study_year' => 2019,
'citation_pubmed_id' => '30924169',
'indication' => 'Type 2 diabetes — oral formulation',
),
// TB-500 (2 rows).
[ 'peptide' => 'tb-500', 'dose_min' => 2, 'dose_max' => 2.5, 'dose_unit' => 'mg', 'route' => 'subq', 'frequency' => 'twice weekly', 'population' => 'animal', 'evidence_strength' => 'preclinical', 'study_title' => 'Thymosin beta-4 promotes dermal healing in rats', 'study_year' => 2007, 'citation_pubmed_id' => '17584560' ],
[ 'peptide' => 'tb-500', 'dose_min' => 5, 'dose_max' => 5, 'dose_unit' => 'mg', 'route' => 'subq', 'frequency' => 'weekly', 'population' => 'animal', 'evidence_strength' => 'preclinical', 'study_title' => 'TB4 cardiac repair in murine MI model', 'study_year' => 2012, 'citation_pubmed_id' => '22561753' ],
];
array(
'peptide' => 'tb-500',
'dose_min' => 2,
'dose_max' => 2.5,
'dose_unit' => 'mg',
'route' => 'subq',
'frequency' => 'twice weekly',
'population' => 'animal',
'evidence_strength' => 'preclinical',
'study_title' => 'Thymosin beta-4 promotes dermal healing in rats',
'study_year' => 2007,
'citation_pubmed_id' => '17584560',
),
array(
'peptide' => 'tb-500',
'dose_min' => 5,
'dose_max' => 5,
'dose_unit' => 'mg',
'route' => 'subq',
'frequency' => 'weekly',
'population' => 'animal',
'evidence_strength' => 'preclinical',
'study_title' => 'TB4 cardiac repair in murine MI model',
'study_year' => 2012,
'citation_pubmed_id' => '22561753',
),
);
$count = 0;
foreach ( $rows as $row ) {
@@ -156,7 +284,7 @@ class PR_Core_Seed_Data {
$row['added_by'] = get_current_user_id() ?: 1;
if ( $repo->insert( $row ) > 0 ) {
$count++;
++$count;
}
}
@@ -171,13 +299,44 @@ class PR_Core_Seed_Data {
*/
private static function seed_legal_cells( array $peptide_ids ): int {
$repo = new PR_Core_Legal_Repository();
$cells = [
[ 'peptide' => 'bpc-157', 'country_code' => 'US', 'status' => 'ruo', 'regulatory_framework' => 'Not FDA-approved; available as Research Use Only', 'notes' => 'Compounding pharmacies may dispense under FDA 503A/503B exemptions.' ],
[ 'peptide' => 'bpc-157', 'country_code' => 'GB', 'status' => 'unclear', 'regulatory_framework' => 'Not listed by MHRA', 'notes' => 'No specific scheduling; import for personal use is a grey area.' ],
[ 'peptide' => 'semaglutide', 'country_code' => 'US', 'status' => 'prescription', 'regulatory_framework' => 'FDA-approved (Ozempic, Wegovy, Rybelsus)', 'regulatory_text_url' => 'https://www.accessdata.fda.gov/drugsatfda_docs/label/2023/209637s020lbl.pdf', 'notes' => 'Schedule IV not applicable; requires valid prescription.' ],
[ 'peptide' => 'semaglutide', 'country_code' => 'GB', 'status' => 'prescription', 'regulatory_framework' => 'MHRA-approved (Ozempic, Wegovy)', 'notes' => 'Available via NHS and private prescription.' ],
[ 'peptide' => 'semaglutide', 'country_code' => 'AU', 'status' => 'prescription', 'regulatory_framework' => 'TGA-approved (Ozempic)', 'notes' => 'PBS-listed for type 2 diabetes; Wegovy approval pending as of 2025.' ],
];
$cells = array(
array(
'peptide' => 'bpc-157',
'country_code' => 'US',
'status' => 'ruo',
'regulatory_framework' => 'Not FDA-approved; available as Research Use Only',
'notes' => 'Compounding pharmacies may dispense under FDA 503A/503B exemptions.',
),
array(
'peptide' => 'bpc-157',
'country_code' => 'GB',
'status' => 'unclear',
'regulatory_framework' => 'Not listed by MHRA',
'notes' => 'No specific scheduling; import for personal use is a grey area.',
),
array(
'peptide' => 'semaglutide',
'country_code' => 'US',
'status' => 'prescription',
'regulatory_framework' => 'FDA-approved (Ozempic, Wegovy, Rybelsus)',
'regulatory_text_url' => 'https://www.accessdata.fda.gov/drugsatfda_docs/label/2023/209637s020lbl.pdf',
'notes' => 'Schedule IV not applicable; requires valid prescription.',
),
array(
'peptide' => 'semaglutide',
'country_code' => 'GB',
'status' => 'prescription',
'regulatory_framework' => 'MHRA-approved (Ozempic, Wegovy)',
'notes' => 'Available via NHS and private prescription.',
),
array(
'peptide' => 'semaglutide',
'country_code' => 'AU',
'status' => 'prescription',
'regulatory_framework' => 'TGA-approved (Ozempic)',
'notes' => 'PBS-listed for type 2 diabetes; Wegovy approval pending as of 2025.',
),
);
$count = 0;
foreach ( $cells as $cell ) {
@@ -192,7 +351,7 @@ class PR_Core_Seed_Data {
$cell['reviewer_id'] = get_current_user_id() ?: 1;
if ( $repo->insert( $cell ) > 0 ) {
$count++;
++$count;
}
}