{"id":168947,"date":"2021-02-02T17:00:02","date_gmt":"2021-02-02T14:00:02","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/constructor-property-promotion-in-php-8-cloudsavvy-it\/"},"modified":"2021-02-02T17:00:02","modified_gmt":"2021-02-02T14:00:02","slug":"constructor-property-promotion-in-php-8-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/constructor-property-promotion-in-php-8-cloudsavvy-it\/","title":{"rendered":"#Constructor Property Promotion in PHP 8 \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2910c029abb\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2910c029abb\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/constructor-property-promotion-in-php-8-cloudsavvy-it\/#A_Traditional_Class\" >A Traditional Class<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/constructor-property-promotion-in-php-8-cloudsavvy-it\/#A_Closer_Look\" >A Closer Look<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/constructor-property-promotion-in-php-8-cloudsavvy-it\/#Using_With_a_Constructor_Body\" >Using With a Constructor Body<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/constructor-property-promotion-in-php-8-cloudsavvy-it\/#Combining_with_Regular_Properties_and_Parameters\" >Combining with Regular Properties and Parameters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/constructor-property-promotion-in-php-8-cloudsavvy-it\/#Use_with_Attributes\" >Use with Attributes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/constructor-property-promotion-in-php-8-cloudsavvy-it\/#Reflection\" >Reflection<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/buradabiliyorum.com\/en\/constructor-property-promotion-in-php-8-cloudsavvy-it\/#Possible_Gotchas\" >Possible Gotchas<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/buradabiliyorum.com\/en\/constructor-property-promotion-in-php-8-cloudsavvy-it\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#Constructor Property Promotion in PHP 8 \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4047\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/b835749967babe94be45e3edd2508d9c\/p\/uploads\/2017\/08\/1ac500da.png\" alt=\"PHP Logo\" width=\"1400\" height=\"600\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Constructor property promotion is a new PHP 8 convenience feature which helps you minimise code repetition. It lets you combine the definition and initialisation of properties into a single constructor statement.<\/p>\n<h2 id=\"a-traditional-class\"><span class=\"ez-toc-section\" id=\"A_Traditional_Class\"><\/span>A Traditional Class<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Constructor property promotion (CPP from hereon) is most useful in the context of value objects. These tend to be simple classes which describe a data structure. Here\u2019s what one might look like in PHP 7.4:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"php\">\n<pre class=\"de1\"><span class=\"kw2\">class<\/span> BlogPost <span class=\"br0\">{<\/span>\n\u00a0\n    <span class=\"kw2\">protected<\/span> string <span class=\"re0\">$Title<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n    <span class=\"kw2\">protected<\/span> string <span class=\"re0\">$Content<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n    <span class=\"kw2\">protected<\/span> DateTimeImmutable <span class=\"re0\">$PostedDate<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n\u00a0\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> __construct<span class=\"br0\">(<\/span>\n        string <span class=\"re0\">$Title<\/span><span class=\"sy0\">,<\/span>\n        string <span class=\"re0\">$Content<\/span><span class=\"sy0\">,<\/span>\n        DateTimeImmutable <span class=\"re0\">$PostedDate<\/span><span class=\"br0\">)<\/span> <span class=\"br0\">{<\/span>\n\u00a0\n        <span class=\"re0\">$this<\/span> <span class=\"sy0\">-&gt;<\/span> <span class=\"me1\">Title<\/span> <span class=\"sy0\">=<\/span> <span class=\"re0\">$Title<\/span><span class=\"sy0\">;<\/span>\n        <span class=\"re0\">$this<\/span> <span class=\"sy0\">-&gt;<\/span> <span class=\"me1\">Content<\/span> <span class=\"sy0\">=<\/span> <span class=\"re0\">$Content<\/span><span class=\"sy0\">;<\/span>\n        <span class=\"re0\">$this<\/span> <span class=\"sy0\">-&gt;<\/span> <span class=\"me1\">PostedDate<\/span> <span class=\"sy0\">=<\/span> <span class=\"re0\">$PostedDate<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"br0\">}<\/span>\n\u00a0\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>We\u2019ve created a reasonably lengthy class, despite having only three properties! Each property name occurs four times, with the typehints being written twice. If you needed to amend one of the properties, or add another, you\u2019d be touching three lines of code.<\/p>\n<p>Here\u2019s the same example, rewritten to use CPP in PHP 8:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"php\">\n<pre class=\"de1\"><span class=\"kw2\">class<\/span> BlogPost <span class=\"br0\">{<\/span>\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> __construct<span class=\"br0\">(<\/span>\n        <span class=\"kw2\">protected<\/span> string <span class=\"re0\">$Title<\/span><span class=\"sy0\">,<\/span>\n        <span class=\"kw2\">protected<\/span> string <span class=\"re0\">$Content<\/span><span class=\"sy0\">,<\/span>\n        <span class=\"kw2\">protected<\/span> DateTimeImmutable <span class=\"re0\">$PostedDate<\/span><span class=\"br0\">)<\/span> <span class=\"br0\">{<\/span><span class=\"br0\">}<\/span>\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>By using CPP we\u2019ve drastically cut the size of our class. You\u2019d only need to add or alter one line of code when working with this class\u2019 properties.<\/p>\n<h2 id=\"a-closer-look\"><span class=\"ez-toc-section\" id=\"A_Closer_Look\"><\/span>A Closer Look<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>CPP combines property definition with the constructor\u2019s parameter list. To create a promoted property, prefix its name with a class visibility modifier \u2013 <code>public<\/code>, <code>protected<\/code> or <code>private<\/code>.<\/p>\n<p>Once promoted, the property behaves like any other class property. You can access it within the class using <code>$this -&gt; Property<\/code> or externally (if it\u2019s a <code>public<\/code> property). Internally, PHP\u2019s simply transforming the compact syntax into the much lengthier version supported by PHP 7.<\/p>\n<p>You don\u2019t have to use typehints with promoted properties \u2013 it\u2019s acceptable to write <code>protected $Title<\/code>, for example. You can set default values using the same syntax as a regular constructor parameter (<code>protected string $Title = \"Example Post\"<\/code>).<\/p>\n<h2 id=\"using-with-a-constructor-body\"><span class=\"ez-toc-section\" id=\"Using_With_a_Constructor_Body\"><\/span>Using With a Constructor Body<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Your constructor won\u2019t always be quite as simple as our example. You might need to perform some validation checks or transform a value.<\/p>\n<p>You can still write a constructor body when using CPP. You\u2019ll be able to access the values of your promoted properties either as the promoted instance variable or using the local variable:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"php\">\n<pre class=\"de1\"><span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> __construct<span class=\"br0\">(<\/span><span class=\"kw2\">protected<\/span> string <span class=\"re0\">$Title<\/span><span class=\"br0\">)<\/span> <span class=\"br0\">{<\/span>\n    <span class=\"kw1\">if<\/span> <span class=\"br0\">(<\/span><span class=\"sy0\">!<\/span><span class=\"re0\">$this<\/span> <span class=\"sy0\">-&gt;<\/span> <span class=\"me1\">Title<\/span><span class=\"br0\">)<\/span> <span class=\"br0\">{<\/span>\n        <span class=\"kw1\">throw<\/span> <span class=\"kw2\">new<\/span> InvalidArgumentException<span class=\"br0\">(<\/span><span class=\"st0\">\"Title cannot be empty.\"<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"br0\">}<\/span>\n    <span class=\"co1\">\/\/ OR<\/span>\n    <span class=\"kw1\">if<\/span> <span class=\"br0\">(<\/span><span class=\"sy0\">!<\/span><span class=\"re0\">$Title<\/span><span class=\"br0\">)<\/span> <span class=\"br0\">{<\/span>\n        <span class=\"kw1\">throw<\/span> <span class=\"kw2\">new<\/span> InvalidArgumentException<span class=\"br0\">(<\/span><span class=\"st0\">\"Title cannot be empty.\"<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"br0\">}<\/span>\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Whichever <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>roach you choose, the variable or the property, you\u2019ll be working with the same value. PHP simply hides the <code>$this -&gt; Title = $Title<\/code> line you\u2019d normally be writing manually.<\/p>\n<h2 id=\"combining-with-regular-properties-and-parameters\"><span class=\"ez-toc-section\" id=\"Combining_with_Regular_Properties_and_Parameters\"><\/span>Combining with Regular Properties and Parameters<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can freely mix promoted properties with regular property definitions. In addition, you can combine promoted and non-promoted properties in your constructor parameters.<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"php\">\n<pre class=\"de1\"><span class=\"kw2\">class<\/span> BlogPost <span class=\"br0\">{<\/span>\n    <span class=\"kw2\">public<\/span> ?DateTimeImmutable <span class=\"re0\">$PostedDate<\/span> <span class=\"sy0\">=<\/span> <span class=\"kw4\">null<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> __construct<span class=\"br0\">(<\/span><span class=\"kw2\">public<\/span> string <span class=\"re0\">$Title<\/span><span class=\"sy0\">,<\/span> bool <span class=\"re0\">$isPosted<\/span><span class=\"sy0\">=<\/span><span class=\"kw4\">true<\/span><span class=\"br0\">)<\/span> <span class=\"br0\">{<\/span>\n        <span class=\"kw1\">if<\/span> <span class=\"br0\">(<\/span><span class=\"re0\">$isPosted<\/span><span class=\"br0\">)<\/span> <span class=\"re0\">$this<\/span> <span class=\"sy0\">-&gt;<\/span> <span class=\"me1\">PostedDate<\/span> <span class=\"sy0\">=<\/span> <span class=\"kw2\">new<\/span> DateTimeImmutable<span class=\"br0\">(<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"br0\">}<\/span>\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>You should be careful when mixing these syntaxes together. Promoted properties can easily be overlooked when skimming the code, especially if preceded by regular class property definitions. If your class already possesses several properties using the traditional form, using the new syntax for one extra addition might not be the best approach for that file.<\/p>\n<h2 id=\"use-with-attributes\"><span class=\"ez-toc-section\" id=\"Use_with_Attributes\"><\/span>Use with Attributes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>One of PHP 8\u2019s other new features was attributes. These allow you to annotate extra metadata against entities in your codebase.<\/p>\n<p>Attributes are fully supported on promoted properties. As it\u2019s ambiguous whether the attribute applies to a <em>property definition<\/em> or a <em>method parameter<\/em>, PHP will apply it to both.<\/p>\n<p>That means you\u2019ll get the same value back whether you\u2019re inspecting the property or the constructor parameter. This flexible approach ensures you don\u2019t lose any functionality of attributes by adopting constructor property promotion.<\/p>\n<h2 id=\"reflection\"><span class=\"ez-toc-section\" id=\"Reflection\"><\/span>Reflection<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Promoted properties \u2013 and constructor arguments which promote a property \u2013 behave intuitively when introspected via the Reflection APIs. Reflection looks at promoted properties in their post-transpilation state, so they appear identical to an explicitly declared property.<\/p>\n<p>Both the <code>ReflectionProperty<\/code> and <code>ReflectionParameter<\/code> classes have new <code>isPromoted()<\/code> methods to let you check whether they were involved with CPP. <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/general\/\" data-internallinksmanager029f6b8e52c=\"3\" title=\"General\" target=\"_blank\" rel=\"noopener\">General<\/a>ly, this shouldn\u2019t need to be considered though, unless you\u2019re writing a tool which wants to replicate the exact source structure.<\/p>\n<h2 id=\"possible-gotchas\"><span class=\"ez-toc-section\" id=\"Possible_Gotchas\"><\/span>Possible Gotchas<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You cannot declare duplicate class and promoted property names. The following example would result in a runtime error:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"php\">\n<pre class=\"de1\"><span class=\"kw2\">class<\/span> BlogPost <span class=\"br0\">{<\/span>\n    <span class=\"kw2\">public<\/span> string <span class=\"re0\">$Title<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> __construct<span class=\"br0\">(<\/span><span class=\"kw2\">public<\/span> string <span class=\"re0\">$Title<\/span><span class=\"br0\">)<\/span> <span class=\"br0\">{<\/span><span class=\"br0\">}<\/span>\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This is because PHP doesn\u2019t really do anything special with promoted property definitions. It simply transpiles your terse source code into the PHP 7.4 style. This would result in two <code>public string $Title<\/code> lines, which has always been forbidden.<\/p>\n<p>There are other cases where CPP might result in an error. Promoted properties are forbidden in abstract classes, although they can be used in traits. You\u2019re unable to use the <code>callable<\/code> type with them because it\u2019s not supported for property definitions. Finally, there\u2019s no support for variadic parameters (e.g.\u00a0<code>public string ...$strings<\/code>) because the property would end up being an <code>array<\/code> of <code>string<\/code> instances, not a <code>string<\/code> itself.<\/p>\n<h2 id=\"conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Constructor property promotion makes it much quicker to write new value objects in your codebase. It can cut the number of lines by up to two thirds! CPP also helps you DRY (Don\u2019t Repeat Yourself) your code by avoiding the unsightly repetition of typehints and property names which PHP 7.4 required.<\/p>\n<p>Adopting CPP is optional and won\u2019t always make sense for existing classes. It\u2019s best suited to simple struct-like classes, where you want to provide strong typing to data that\u2019s going to be passed through your codebase.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/9378\/constructor-property-promotion-in-php-8\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#Constructor Property Promotion in PHP 8 \u2013 CloudSavvy IT&#8221; Constructor property promotion is a new PHP 8 convenience feature which helps you minimise code repetition. It lets you combine the definition and initialisation of properties into a single constructor statement. A Traditional Class Constructor property promotion (CPP from hereon) is most useful in the context&#8230;<\/p>\n","protected":false},"author":1,"featured_media":168948,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2017\/08\/1ac500da.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-168947","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/168947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=168947"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/168947\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/168948"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=168947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=168947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=168947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}